package com.xuanmiao.smsback.service.scheduled;

import com.xuanmiao.smsback.service.notice.INoticeService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author shenJianKang
 * @date 2019/9/11 14:27
 *
 * 商家公告定時任務
 */

@Component
@JobHandler(value = "BusinessNoticeJob")
public class BusinessNoticeJob extends IJobHandler {
    private final Logger LOGGER = LoggerFactory.getLogger(getClass());

    @Autowired
    private INoticeService noticeService;


    @Override
    public ReturnT<String> execute(String s) throws Exception {

        try {
            noticeService.businessNoticeJob();
        }catch (Exception e){
            return FAIL;
        }
        return SUCCESS;
    }


}
